package com.cuij.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cuij.entity.Result;
import com.cuij.service.orderBusiService;

@Controller
@RequestMapping("/busi")
public class orderBusiController {

    @Resource
    private orderBusiService orderbusiservice;

    @RequestMapping("/findbusiid.do")
    @ResponseBody
    public Result findBusiIdExecute(String use_id) {
        Result result = orderbusiservice.findBusiIdByUseId(use_id);
        return result;

    }

    // 查询用户信息
    @RequestMapping("/findbusiinfo.do")
    @ResponseBody
    public Result findBusiInfoExecute(String busi_id) {
        Result result = orderbusiservice.findBusiInfoByBusiId(busi_id);
        return result;
    }

    // 修改商家信息
    @RequestMapping("/modifybusiinfo")
    @ResponseBody
    public Result modifyBusiInfoExecute(String busi_id, String busi_type, String busi_desc, String busi_pic,
            String busi_linkname, String busi_linkphone, String busi_address, String busi_atten, String oldfilename) {
        Result result = orderbusiservice.modifyBusiInfo(busi_id, busi_type, busi_desc, busi_pic, busi_linkname,
                busi_linkphone, busi_address, busi_atten, oldfilename);
        return result;
    }

    // 查询账户信息
    @RequestMapping("/querybusimoney")
    @ResponseBody
    public Result queryBusiMoneyExecute(String busi_id) {
        Result result = orderbusiservice.querybusimoney(busi_id);
        return result;
    }

    // 查询所有商家
    @RequestMapping("/querybusi.do")
    @ResponseBody
    public Result queryBusiExecute() {
        Result result = orderbusiservice.querybusi();
        return result;
    }

    // 按类别查询商家
    @RequestMapping("/querybusibytype.do")
    @ResponseBody
    public Result queryBusiByType(String type) {
        Result result = orderbusiservice.querybusibytype(type);
        return result;
    }

    // 在某类别下按条件查询
    @RequestMapping("/querybusibyterm.do")
    @ResponseBody
    public Result queryBusiByTerm(String type, String term) {
        Result result = orderbusiservice.querybusibyterm(type, term);
        return result;
    }
}
